home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / jcool01.zip / CHAR.H < prev    next >
C/C++ Source or Header  |  1992-08-11  |  3KB  |  80 lines

  1. //
  2. // Copyright (C) 1991 Texas Instruments Incorporated.
  3. //
  4. // Permission is granted to any individual or institution to use, copy, modify,
  5. // and distribute this software, provided that this complete copyright and
  6. // permission notice is maintained, intact, in all copies and supporting
  7. // documentation.
  8. //
  9. // Texas Instruments Incorporated provides this software "as is" without
  10. // express or implied warranty.
  11. //
  12. //
  13. // Created: MBN 04/04/89 -- Initial design and implementation
  14. // Updated: DKM 07/07/89 -- To work around Xenix 31 char limit:
  15. //                          Shortened is_less_than        to is_lt
  16. //                                    is_greater_than     to is_gt
  17. //                                    is_less_or_equal    to is_le
  18. //                                    is_greater_or_equal to is_ge
  19. // Updated: MBN 12/15/89 -- Made case-flag optional on is_equal, is_not_equal
  20. // Updated: DLS 03/22/91 -- New lite version
  21. // Updated: JAM 08/11/92 -- removed DOS specifics, stdized #includes
  22. // Updated: JAM 08/11/92 -- removed "fast" TOLOWER/UPPER; just use ANSI C's
  23. //
  24. // This   header  file   defines function   prototypes   for extended    char*
  25. // functionality patterned after  that of the  CoolString class. This will allow a
  26. // programmer to chose char* or CoolString strings  for an application  based upon
  27. // the needs of the program and not the availability  of a particular function
  28. // or functions. Note  that there  is no attempt  to  allocate  or  deallocate
  29. // memory.  Functions for  comparison (both case  sensitive  and insensitive),
  30. // case conversion and  string  token  trimming are provided.   All  functions
  31. // assume pointer operands are passed.
  32. //
  33.  
  34. #ifndef CHARH            // If not yet defined,
  35. #define CHARH            // Indicate that char* header defined
  36.  
  37. #include <string.h>        // Include standard string header file
  38. #include <iostream.h>
  39.  
  40. #ifndef MISCELANEOUSH                // If no misc.h file
  41. #include <misc.h>            // Include useful defintions
  42. #endif    
  43.  
  44. void reverse (char*);        // Reverse character order in string
  45.  
  46. extern Boolean is_equal_n (const char*, const char*, int n,
  47.                Boolean case_flag=INSENSITIVE);
  48.  
  49. extern Boolean is_equal (const char*, const char*,
  50.              Boolean case_flag=INSENSITIVE);
  51.  
  52. extern Boolean is_not_equal (const char*, const char*,
  53.                  Boolean case_flag=INSENSITIVE);
  54.  
  55. extern Boolean is_lt (const char*, const char*, Boolean);
  56. extern Boolean is_gt (const char*, const char*, Boolean);
  57. extern Boolean is_le (const char*, const char*, Boolean);
  58. extern Boolean is_ge (const char*, const char*, Boolean);
  59.  
  60. extern char* c_trim (char*, const char*);    // Trim characters from string
  61. extern char* c_left_trim (char*, const char*);    // Trim prefix characters
  62. extern char* c_right_trim (char*, const char*);    // Trim suffix characters
  63.  
  64. extern char* c_upcase (char*);            // Convert string to upper case
  65. extern char* c_downcase (char*);        // Convert string to lower case
  66. extern char* c_capitalize (char*);        // Capitalize each word 
  67. extern const char* strfind (const char*, const char*,
  68.                 long* start=0, long* end=0);
  69. extern const char* strrfind (const char*, const char*,
  70.                  long* start=0, long* end=0);
  71. extern char* strnremove (char*, long);
  72. extern char* strndup (const char*, long);
  73. extern char* strnyank (char*, long);
  74.  
  75. #define TO_LOWER tolower
  76. #define TO_UPPER toupper
  77.  
  78. #endif                        // End #ifdef of CHARH
  79.  
  80.